<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="p" value="${param}"></c:set>
 <div id="product_tabs" class="easyui-tabs" data-options="tools:'#tab-tools'" >
     <div title="商品基础信息" style="padding:5px;">
		<iframe scrolling="auto" frameborder="0"  src="<c:url value="/views/jsp/product/product_save_update_s.jsp" />?productCode=<c:out value="${p.productCode}" />" style="width:100%;height:100%;" ></iframe>
	</div>
	 <div title="商品图片" id="tabs_pic" >
	 	<iframe scrolling="auto" frameborder="0"  src="<c:url value="/views/jsp/product/product_pic_s.jsp" />?productCode=<c:out value="${p.productCode}" />" style="width:100%;height:100%;" ></iframe>
	 </div>
	 <div title="商品资质文件" id="tabs_quantity" >
	 	<iframe scrolling="auto" frameborder="0"  src="<c:url value="/views/jsp/product/product_qualification_s.jsp" />?productCode=<c:out value="${p.productCode}" />" style="width:100%;height:100%;" ></iframe>
	 </div>
	 <div title="商品说明书"    >
	 	<iframe scrolling="auto" frameborder="0"  src="<c:url value="/views/jsp/product/product_instruction_s.jsp" />?productCode=<c:out value="${p.productCode}" />" style="width:100%;height:100%;" ></iframe>
	 </div>
</div>
<div id="tab-tools" style="float: left;display: none;" >
    <a href="javascript:checkIn();" class="easyui-linkbutton" data-options="iconCls:'ext-icon-shield'">审核通过</a>
    <a href="javascript:checkError();" class="easyui-linkbutton" data-options="iconCls:'ext-icon-shield_delete'">审核不通过</a>
</div>

<script type="text/javascript">
var productCode = '${p.productCode}';
$(function(){
	console.log('${p.productCode}');
	var ifHeight = $("#w_product_tabs").height();
	$("#product_tabs iframe").css("height",ifHeight-50);
	$("#product_tabs").tabs({
	    border:false,
	    onSelect:function(title){
	     
	    }
	});
	
}); 

function checkIn(){
	$.messager.confirm('确认', '您确定审核通过该条记录吗？', function(r) {
		var param = {"productCode":productCode};
		if(r){
			param["approveStatus"]="10";
			$.pmsAjax({
				url:'<c:url value="/product/updateEmBProduct.do"/>',
				data:param,
				success:function(data){
					if(data.code=="200"){
						alertShow("审核成功");
						$("#w_product_tabs").dialog('close');
					}else{
						alertError(data.result);
					}
				}
			});
		} 
	});
}
function checkError(){
	$.messager.confirm('确认', '该条记录审核不通过吗？', function(r) {
		var param = {"productCode":productCode};
		if(r){
			param["approveStatus"]="-99";
			$.pmsAjax({
				url:'<c:url value="/product/updateEmBProduct.do"/>',
				data:param,
				success:function(data){
					if(data.code=="200"){
						alertShow("审核操作成功");
						$("#w_product_tabs").dialog('close');
					}else{
						alertError(data.result);
					}
				}
			});
		} 
	});
}
</script>
